#pragma once
#include "stdafx.h"

using namespace std;

class SobelProcessor
{
public:
	
	SobelProcessor(void);
	~SobelProcessor(void);
	SobelProcessor(IplImage* src,CString sImageName);
	pair<int,int> MarkPeaks(void);
	

	
private:

	void Dump2Txt(IplImage* img, CString sFile);
	vector<int> Convolve(vector<int>& signal, vector<int>& kernel);
	vector<int> CountGrayScales(IplImage* img);
	int MarkSecondPeak(vector<int>& counts , int firstPos);
	int MarkFirstPeak(vector<int>& counts);
	void DrawMarkOnImage(int firstPeak, int secondPeak);
	CString   m_ImageName;
	IplImage* m_Image;
	
};

